package com.example.joker.abao00;

import android.content.Intent;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;

/**
 * Created by Joker on 2015/12/18..
 */
public class ChatFragment extends Fragment {
    @Override
    public View onCreateView(LayoutInflater inflater,ViewGroup container,Bundle savedInstanceState){
        View view=inflater.inflate(R.layout.chat_fragment,container,false);
        Button button=(Button)view.findViewById(R.id.button);
        button.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                /**
                 * chatfragment的寄主活动不是MainActibity,而是fragment manager里面的相关逻辑
                 */
                Intent intent=new Intent(getActivity(),ChatRobot.class);
                startActivity(intent);
            }
        });
        return view;
    }
}

